
#include	<string.h>
#include	<sys/time.h>


//-------------------------------------------------------------
int get_substr(int start_index, int end_index, char * source, char * result_to_return) {
	int i = 0, j = 0;
	int STRING_SIZE=1024;
	char SPACE=' ';

	memset(result_to_return, '\0', STRING_SIZE);

	for (i = start_index; i < end_index; i++) {
		if (source[i] == SPACE)
			break;
		result_to_return[j] = source[i];
		j++;
	}
	return i;
}

double getMiliSeconds() {
	double m;
	struct timeval mtv;
	gettimeofday(&mtv, NULL);
	m = 1000 * mtv.tv_sec + mtv.tv_usec / (double) 1000;
	return m;
}
